<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport"
			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	</head>
	<style type="text/css">
		html,
		body {
			width: 100%;
			height: 100%;
			align-items: center;
			display: flex;
			justify-content: center;
			position: relative;
		}

		.box {
			position: absolute;
			top: 30%;
			left: 50%;
			transform: translate(-50%, -50%);
			width: 100%;
			text-align: center;
		}

		.logoBox {
			text-align: center;
		}

		.logoBox img {
			width: 80px;
			border-radius: 10px;
		}

		.boxButton {
			width: 90%;
			padding: 10px 21px;
			background-color: #ffbe53;
			border: none;
			font-size: 16px;
			color: #fff;
			border-radius: 10px;
		}

		.textBox {
			margin: 20px auto;
			width: 50%;
			font-size: 16px;
			color: #aaaaaa;
		}
	</style>
	<body>
		<div class="box">
			<div class="logoBox">
				<img src="logo.png">
			</div>
			<div class="textBox">
				如果没有自动跳转请点击<strong>授权并继续</strong>
			</div>
			<div>
				<button class="boxButton" onclick="buttonFun()">授权并继续</button>
			</div>
		</div>
		<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js">
		</script>
		<script type="text/javascript">
			window.onload = function() {
				setTimeout(() => {
					uni.postMessage({
						data: GetRequest()
					})
				}, 0);
				buttonFun()
			}

			function buttonFun() {
				uni.postMessage({
					data: GetRequest()
				})
			}

			function getQueryVariable(variable) {
				var query = window.location.search.substring(1);
				var vars = query.split("&");
				for (var i = 0; i < vars.length; i++) {
					var pair = vars[i].split("=");
					if (pair[0] == variable) {
						return pair[1];
					}
				}
				return (false);
			}

			var Request = new Object();
			Request = GetRequest();


			function GetRequest() {
				var url = location.search; //获取url中"?"符后的字串
				var theRequest = new Object();
				if (url.indexOf("?") != -1) {
					var str = url.substr(1);
					strs = str.split("&");
					for (var i = 0; i < strs.length; i++) {
						theRequest[strs[i].split("=")[0]] = strs[i].split("=")[1];
					}
				}
				return theRequest;
			}
		</script>
	</body>

</html>
